Team Crimson - Arun, Varun, Jasdeep, Mohit, Pradnya
Abstract
This data visualization project aims to comprehend the patterns in the stock prices of major tech companies over a 10-year period. Given the inherent volatility of stock prices, various factors, including external disturbances, contribute to fluctuations. The project delves into comprehending the patterns in big tech company stock prices, particularly with respect to the impact of COVID-19. Our visualization techniques, including bar plots and line plots, play a crucial role in explaining the stock price phenomena.
In the second part of the project, we offer a more lucid understanding of stock price trends across financial quarters and weekdays. This insightful analysis empowers stakeholders with the information needed for informed decision-making and the formulation of proactive trading strategies.
Note: Given that we only have access to stock prices, establishing causality regarding the impact of stock prices in relation to COVID-19 may pose challenges. So, instead we will be observing trends and returns.
Introduction
The Big Tech Stock Prices dataset, sourced from the TidyTuesday project, provides a comprehensive overview of the daily stock prices and trading volumes of 14 prominent technology companies. The list of industry giants that are studied for data analysis are Apple, Adobe, Amazon.com, Salesforce, Cisco Systems, Alphabet, IBM, Intel, Meta, Microsoft, Netflix, NVIDIA, Oracle and TESLA.
Comprising two tables, namely big_tech_stock_prices.csv and big_tech_companies.csv, this dataset offers a ample amount of information for conducting in-depth analysis and exploring various aspects of the stock market. The big_tech_stock_prices.csv file contains detailed records of daily stock prices and trading volumes for each company, while the big_tech_companies.csv file provides additional information about the included companies, such as their names and stock symbols.
The data spans a period of 12 years, specifically from 2010 to 2022
Question 1 : Which companies have experienced the highest/lowest impact on their stock prices due to the pandemic?
Introduction
Comprehending the trends in overall stock prices is crucial for grasping the broader impact of stock fluctuations. In this section, we delve into the patterns observed in the adj_close stock prices over a 12-year period, spanning from 2010 to 2022, and examine how they fluctuate throughout this timeframe. The key variables under consideration are primarily adj_close, date, and stock_symbol.
Analyzing stock prices across different companies provides insights into trends over time. For instance, identifying an upward trend in a specific company during a particular period suggests the likelihood of high returns for that duration. Conversely, a downward trend indicates the potential for negative returns. If the trend appears sinusoidal, it signals a seasonal effect with anticipated modest returns over the period.
To delve deeper into these dynamics, we specifically zoom in on the pre and post-COVID times. This focused examination allows us to discern the effects of the pandemic on stock trends, offering a comprehensive understanding of how major tech companies were impacted during and after the COVID-19 era.
Approach
To comprehensively analyze the stock price patterns across various companies over the 12-year period, we will employ three types of plots: two line plots and one bar plot.
For all the plots, the company names will be cleaned and extracted for proper labeling.
In the first line plot, we will depict the overall trends of all companies from 2010 to 2022. The lines will be annotated with the COVID-19 time period, highlighting upward and downward trends. Most lines will be plotted in grey, except for a couple where the trends are particularly conspicuous. Comments will accompany these lines for quick comprehension.
The second line plot zooms into the period from 2018 to 2022. Instead of directly plotting stock prices, we plotted de-trending days plot for which we created 14 models across companies based on stock prices. Ratios are then calculated based on fitted and actual stock prices, offering insights into underlying patterns on a standardized scale. Facets are incorporated to distinguish between the plots, maintaining the color patterns from the first plot.
For the third plot, we consider the starting date of 2018, the year 2020, and the closing date of 2022 to extract two-year and five-year returns. Two-year returns showcase the initial impact of the tech boom before COVID-19, while five-year returns highlight a company’s intrinsic strength despite market fluctuations. The returns are averaged per year for easy comprehension. First, two-year returns for all companies are plotted using a bar plot with descending values. Similarly, five-year returns are plotted. These plots are combined using cowplot and presented side by side, illustrating how returns fluctuated across companies during these two critical time periods.
Analysis
Discussion
<<< Team-1 to write >>
For plot1, most of the companies showed a drop in stock prices in H1 2020 at the start of Covid-19 then recovered back with another drop in year 2022. Netflix and Adobe showed substantial drop in stock prices during the year 2022. The fall in stock prices in year 2022 was mainly due to after Covid-19 effect like slowdown in sales, recession fears, increase in unemployment rate etc.
Plot2 shows detrended stock price fluctuations over the period of 5 years (2018 -2022), most of the stocks are showing significant deviations in trendline 2020 onwards
In Plot3, comparison can be made between average returns over 2 years and 5 year among different stocks. Microsoft had highest returns over 2 years 46.46% which dropped to 39.55% over 5 years where as Tesla had highest 5 year returns of 94.02% ( 17.12% for 2 years)
Adobe had highest negative impact from 44% (2 years) to 17 % (5 years) whereas Tesla had highest positive impact from 17% ( 2 years)to 94% (5 years)
Question 2 : What patterns do we see in the positive gain days over the given period?
Introduction
In the previous question, we observed variations in returns across different companies during the COVID-19 pandemic and the five-year period. In this question, our focus shifts to analyzing the number of gain days across the years to identify potential patterns for companies.
To compute the gain_days variable, we leverage the open and close variables on the same day. If the closing price is higher than the opening price, we designate it as a gain (1), otherwise, it is categorized as no gain (0). The other key variables under consideration include date and stock_symbol.
Analyzing gain_days across different companies offers valuable insights for trading strategies, specifically in determining optimal entry and exit points. This analysis gains further depth when overlapped with weekdays. For instance, if the average gain day is lower on Monday and higher on Friday for a particular company, it suggests that buying on Monday and selling on Friday could be a more favorable strategy.
This information is particularly beneficial in short-term trading scenarios compared to long-term trading. Moreover, it proves useful in uncertain market conditions, providing traders with actionable insights for decision-making.
Approach
To comprehensively analyze gain-day patterns across various companies over the 12-year period, we will employ two distinct types of plots: a column plot and a ridge plot.
For all the plots, meticulous attention will be given to cleaning and extracting company names to ensure accurate labeling.
In the first column plot, our objective is to illustrate the overall gain-days of all companies from 2010 to 2022 on a yearly basis. For this purpose, the gain_days data will be aggregated yearly, generating an animated series of 12 column charts representing different companies. This dynamic presentation provides insights into specific peaks and troughs for gain days across these years for various companies. Additionally, the number of gain days will be annotated using geom_text for a swift comprehension of the numerical values within the animated plot.
The second plot delves into weekday analysis, offering a deeper understanding of trading dynamics. Gain-days will be grouped by quarter and weekday, ensuring an average of approximately 12 weekdays per quarter. Ridge density plots across weekdays will visually articulate the spread and peaks of gains, facilitating the identification of which specific day is more favorable for trading in the context of individual tech companies.
These visualizations collectively provide a nuanced understanding of gain-day patterns, empowering traders with valuable insights for informed decision-making. The integration of both yearly trends and weekday analyses offers a holistic perspective on trading dynamics over the analyzed 12-year period.
---title: "Big Tech Stock Prices"subtitle: "INFO 526 - Project 1"author: - name: "Team Crimson - Arun, Varun, Jasdeep, Mohit, Pradnya"format: html: embed-resources: true code-line-numbers: true code-overflow: wrap code-tools: trueeditor: visualcode-annotations: hovercategories: - Data visualization - TidyTuesday---## AbstractThis data visualization project aims to comprehend the patterns in the stock prices of major tech companies over a 10-year period. Given the inherent volatility of stock prices, various factors, including external disturbances, contribute to fluctuations. The project delves into comprehending the patterns in big tech company stock prices, particularly with respect to the impact of COVID-19. Our visualization techniques, including bar plots and line plots, play a crucial role in explaining the stock price phenomena.In the second part of the project, we offer a more lucid understanding of stock price trends across financial quarters and weekdays. This insightful analysis empowers stakeholders with the information needed for informed decision-making and the formulation of proactive trading strategies.[*Note: Given that we only have access to stock prices, establishing causality regarding the impact of stock prices in relation to COVID-19 may pose challenges. So, instead we will be observing trends and returns.*]{style="font-size: small;"}## IntroductionThe [Big Tech Stock Prices dataset](https://github.com/rfordatascience/tidytuesday/tree/master/data/2023/2023-02-07), sourced from the TidyTuesday project, provides a comprehensive overview of the daily stock prices and trading volumes of 14 prominent technology companies. The list of industry giants that are studied for data analysis are Apple, Adobe, Amazon.com, Salesforce, Cisco Systems, Alphabet, IBM, Intel, Meta, Microsoft, Netflix, NVIDIA, Oracle and TESLA.Comprising two tables, namely `big_tech_stock_prices.csv` and `big_tech_companies.csv`, this dataset offers a ample amount of information for conducting in-depth analysis and exploring various aspects of the stock market. The `big_tech_stock_prices.csv` file contains detailed records of daily stock prices and trading volumes for each company, while the `big_tech_companies.csv` file provides additional information about the included companies, such as their names and stock symbols.The data spans a period of 12 years, specifically from 2010 to 2022## Question 1 : Which companies have experienced the highest/lowest impact on their stock prices due to the pandemic?### IntroductionComprehending the trends in overall stock prices is crucial for grasping the broader impact of stock fluctuations. In this section, we delve into the patterns observed in the `adj_close` stock prices over a 12-year period, spanning from 2010 to 2022, and examine how they fluctuate throughout this timeframe. The key variables under consideration are primarily `adj_close`, `date`, and `stock_symbol`.Analyzing stock prices across different companies provides insights into trends over time. For instance, identifying an upward trend in a specific company during a particular period suggests the likelihood of high returns for that duration. Conversely, a downward trend indicates the potential for negative returns. If the trend appears sinusoidal, it signals a seasonal effect with anticipated modest returns over the period.To delve deeper into these dynamics, we specifically zoom in on the pre and post-COVID times. This focused examination allows us to discern the effects of the pandemic on stock trends, offering a comprehensive understanding of how major tech companies were impacted during and after the COVID-19 era.### ApproachTo comprehensively analyze the stock price patterns across various companies over the 12-year period, we will employ three types of plots: two line plots and one bar plot.For all the plots, the company names will be cleaned and extracted for proper labeling.In the first line plot, we will depict the overall `trends of all companies from 2010 to 2022`. The lines will be annotated with the COVID-19 time period, highlighting upward and downward trends. Most lines will be plotted in grey, except for a couple where the trends are particularly conspicuous. Comments will accompany these lines for quick comprehension.The second line plot zooms into the period from 2018 to 2022. Instead of directly plotting stock prices, we plotted `de-trending days` plot for which we created 14 models across companies based on stock prices. Ratios are then calculated based on fitted and actual stock prices, offering insights into underlying patterns on a standardized scale. Facets are incorporated to distinguish between the plots, maintaining the color patterns from the first plot.For the third plot, we consider the starting date of 2018, the year 2020, and the closing date of 2022 to extract two-year and five-year returns. Two-year returns showcase the initial impact of the tech boom before COVID-19, while five-year returns highlight a company's intrinsic strength despite market fluctuations. The returns are averaged per year for easy comprehension. First, two-year returns for all companies are plotted using a `bar plot` with descending values. Similarly, five-year returns are plotted. These plots are combined using `cowplot` and presented side by side, illustrating how returns fluctuated across companies during these two critical time periods.### Analysis```{r}#| label: load-pkgs#| message: FALSE#| warning: FALSE#| echo: FALSE### GETTING THE LIBRARIES#devtools::install_github("choonghyunryu/dlookr")if (!require(pacman))install.packages(pacman)# Loading the librariespacman::p_load(tidyverse, tidytuesdayR, dlookr, ggthemes, ggplot2, gganimate, dplyr, ggridges, formattable, plotly, broom, cowplot, gifski)``````{r}#| label: load-dataset#| message: FALSE#| warning: FALSE#| echo: FALSE#| output: FALSE# Loading the data from tidy tuesday repository#bigtech <- tidytuesdayR::tt_load('2023-02-07')big_tech_stock_prices <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2023/2023-02-07/big_tech_stock_prices.csv')big_tech_companies <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2023/2023-02-07/big_tech_companies.csv')# Data Pre-processing for both the questionsbig_tech_companies <- big_tech_companies |>mutate(CompanyName =str_replace(company, " Inc", ""),CompanyName =if_else(stock_symbol =="IBM", "IBM", CompanyName),CompanyName =str_replace(CompanyName, ",", ""),CompanyName =str_replace(CompanyName, ".com", ""),CompanyName =str_replace(CompanyName, "\\.", ""),CompanyName =str_replace(CompanyName, "Corporation", ""),CompanyName =str_replace(CompanyName, "Systems", ""),CompanyName =str_replace(CompanyName, "Platforms", ""),CompanyName =str_trim(CompanyName) )``````{r}#| label: graph1#| message: FALSE#| warning: FALSE#| echo: FALSE#| fig-width: 8#| fig-align: center#| dpi: 300plot1 <-left_join(big_tech_stock_prices,big_tech_companies) |>ggplot(aes(x=date,y=adj_close , color = CompanyName)) +geom_line() +scale_colour_manual(name ="Company", values =c("orange", "grey", "grey", "grey", "grey","grey", "grey", "grey", "grey","brown","grey", "grey", "grey", "grey")) +scale_x_date(breaks =seq(from =as.Date("2010-01-01"),to =as.Date("2022-01-01"),by ="2 years"),minor_breaks ="1 year",date_labels ="%Y") +scale_y_continuous(limits =c(0, 750)) +annotate("text",x =as.Date("2020-03-17"),y =680,label ="COVID-19 \n Pandemic",vjust =-0.5, # Adjust vertical position of the labelcolor ="cornsilk4" ) +geom_vline(xintercept =as.numeric(as.Date("2021-11-17")),linetype ="dashed",color ="darkgreen" ) +annotate("text",x =as.Date("2021-11-17"),y =680,label ="Lower Ad \n Revenue",vjust =-0.5, # Adjust vertical position of the labelcolor ="darkred" ) +geom_vline(xintercept =as.numeric(as.Date("2020-03-17")),linetype ="dashed",color ="darkgreen" ) +labs(x ="Year", y ="Stock Price", fill =NULL,title ="" ) +theme_minimal() +theme(legend.position =c(0.10,0.6),legend.box.background =element_rect(fill ="white",color ="white"),legend.title =element_blank() ) +annotate("text",x =as.Date("2015-05-17"),y =300,label ="Highlighted companies in 2022 have faced internal challenges, such as a slowdown in subscribers for Netflix and pricing factors affecting Adobe",vjust =-0.5, # Adjust vertical position of the labelcolor ="darkred",size =3,fontface ="italic" ) +annotate("text",x =as.Date("2016-11-17"),y =500,label ="All tech companies have seen an initial fall when COVID was declared a pandemic, but later, during the quarantine, the benefits of technology are conspicuous",vjust =-0.5, # Adjust vertical position of the labelcolor ="cornsilk4",size =3, fontface ="italic" )plot1``````{r}#| label: graph2#| message: FALSE#| warning: FALSE#| echo: FALSE#| fig-width: 8#| fig-align: center#| dpi: 300models <- big_tech_stock_prices |>group_by(stock_symbol) |>group_modify(~augment(lm(adj_close ~ date, data = .))) |>mutate(ratio = adj_close /.fitted, .after = .fitted) |>select(stock_symbol,date,adj_close,ratio)plot2 <-left_join(models,big_tech_companies) |>ggplot(aes(x = date, y = ratio, color = CompanyName)) +geom_line() +scale_colour_manual(name ="Company", values =c("orange", "grey", "grey", "grey", "grey","grey", "grey", "grey", "grey","brown","grey", "grey", "grey", "grey")) +geom_hline(yintercept =1, color ="darkgreen") +scale_x_date(breaks =seq(from =as.Date("2010-01-01"), to =as.Date("2023-01-01"),by ="2 years"), minor_breaks ="1 year", date_labels ="%Y") +coord_cartesian(ylim =c(0, 2) , xlim =c(as.Date("2018-01-01"), as.Date("2023-01-01"))) +labs(title ="Stock Price Changes over 5 Years",subtitle ="2018-2022 (Detrended)",x ="Year", y ="Stock Price Ratio \n (detrended)" ) +facet_wrap(~CompanyName) +guides(color ="none") +theme_minimal()plot2``````{r}#| label: graph3#| message: FALSE#| warning: FALSE#| echo: FALSE#| fig-width: 8#| fig-align: center#| dpi: 300dates = big_tech_stock_prices |>group_by(year(date)) |>summarize(min_date =min(date), max_date =max(date))dates =c("2018-01-02","2020-01-02", "2022-12-29")closings = big_tech_stock_prices |>filter(as.Date(date) %in%as.Date(dates)) |>mutate(year=year(date)) |>select(stock_symbol,year,adj_close) |>pivot_wider(names_from = stock_symbol, values_from = adj_close) |>column_to_rownames(var ="year") |>t() |>as.data.frame() |>rownames_to_column(var="stock_symbol") |>mutate(Two_Years =round(((`2020`-`2018`)/`2018`)*100/2,2), Five_Years =round(((`2022`-`2018`)/`2018`)*100/5,2) ) |>select(stock_symbol,Two_Years,Five_Years) plot3 <-left_join(closings,big_tech_companies) |>ggplot(aes( x =reorder(CompanyName, Two_Years), Two_Years, fill = CompanyName)) +scale_fill_manual(name ="Company", values =c("orange", "#fde725", "#c2df23", "#86d549", "#52c569","#2ab07f", "#1e9b8a", "#25858e", "#2d708e","brown","#38588c", "#433e85", "#482173", "#440154")) +geom_bar(stat ="identity") +coord_flip() +labs(x ="Two Year Returns",y ="% Returns",title ="Avg. of two year returns %",subtitle ="2018 to 2020; Pre-Pandemic" ) +theme_minimal() +guides(fill ="none") plot4 <-left_join(closings,big_tech_companies) |>ggplot(aes( x =reorder(CompanyName, Five_Years), Five_Years, fill = CompanyName)) +scale_fill_manual(name ="Company", values =c("orange", "#fde725", "#c2df23", "#86d549", "#52c569","#2ab07f", "#1e9b8a", "#25858e", "#2d708e","brown","#38588c", "#433e85", "#482173", "#440154")) +geom_bar(stat ="identity") +coord_flip() +labs(x ="Five Year Returns",y ="% Returns",title ="Avg. of five year returns %",subtitle ="2018 to 2023" ) +theme_minimal() +guides(fill ="none") cowplot::plot_grid(plot3,plot4, ncol =2)```### Discussion\<\<\< Team-1 to write \>\>For plot1, most of the companies showed a drop in stock prices in H1 2020 at the start of Covid-19 then recovered back with another drop in year 2022. Netflix and Adobe showed substantial drop in stock prices during the year 2022. The fall in stock prices in year 2022 was mainly due to after Covid-19 effect like slowdown in sales, recession fears, increase in unemployment rate etc.Plot2 shows detrended stock price fluctuations over the period of 5 years (2018 -2022), most of the stocks are showing significant deviations in trendline 2020 onwardsIn Plot3, comparison can be made between average returns over 2 years and 5 year among different stocks. Microsoft had highest returns over 2 years 46.46% which dropped to 39.55% over 5 years where as Tesla had highest 5 year returns of 94.02% ( 17.12% for 2 years)Adobe had highest negative impact from 44% (2 years) to 17 % (5 years) whereas Tesla had highest positive impact from 17% ( 2 years)to 94% (5 years)## Question 2 : What patterns do we see in the positive gain days over the given period?### IntroductionIn the previous question, we observed variations in returns across different companies during the COVID-19 pandemic and the five-year period. In this question, our focus shifts to analyzing the number of gain days across the years to identify potential patterns for companies.To compute the `gain_days` variable, we leverage the `open` and `close` variables on the same day. If the closing price is higher than the opening price, we designate it as a gain (1), otherwise, it is categorized as no gain (0). The other key variables under consideration include `date` and `stock_symbol`.Analyzing gain_days across different companies offers valuable insights for trading strategies, specifically in determining optimal entry and exit points. This analysis gains further depth when overlapped with weekdays. For instance, if the average gain day is lower on Monday and higher on Friday for a particular company, it suggests that buying on Monday and selling on Friday could be a more favorable strategy.This information is particularly beneficial in short-term trading scenarios compared to long-term trading. Moreover, it proves useful in uncertain market conditions, providing traders with actionable insights for decision-making.### ApproachTo comprehensively analyze gain-day patterns across various companies over the 12-year period, we will employ two distinct types of plots: a column plot and a ridge plot.For all the plots, meticulous attention will be given to cleaning and extracting company names to ensure accurate labeling.In the first column plot, our objective is to illustrate the overall gain-days of all companies from 2010 to 2022 on a yearly basis. For this purpose, the gain_days data will be aggregated yearly, generating an `animated series of 12 column charts` representing different companies. This dynamic presentation provides insights into specific peaks and troughs for gain days across these years for various companies. Additionally, the number of gain days will be annotated using `geom_text` for a swift comprehension of the numerical values within the animated plot.The second plot delves into weekday analysis, offering a deeper understanding of trading dynamics. Gain-days will be grouped by quarter and weekday, ensuring an average of approximately 12 weekdays per quarter. `Ridge density` plots across weekdays will visually articulate the spread and peaks of gains, facilitating the identification of which specific day is more favorable for trading in the context of individual tech companies.These visualizations collectively provide a nuanced understanding of gain-day patterns, empowering traders with valuable insights for informed decision-making. The integration of both yearly trends and weekday analyses offers a holistic perspective on trading dynamics over the analyzed 12-year period.### Analysis```{r}#| label: q2_graph1#| message: FALSE#| warning: FALSE#| echo: FALSE#| fig-width: 8#| fig-align: center#| dpi: 300# Merge datamerged_data <-inner_join(big_tech_stock_prices, big_tech_companies, by ="stock_symbol")# Function to compute gain dayscompute_gain_days <-function(x) { gain_days <-sum(x[-1] > x[-length(x)])return(gain_days)}# Group data by year and company, calculate gain daysgrouped_data <- merged_data |>group_by(year =year(date), CompanyName) |>summarize(GainDays =compute_gain_days(close),.groups ="drop")# Order the companies based on total gain days within each yeargrouped_data <- grouped_data |>group_by(year) |>mutate(Rank =rank(-GainDays)) |>arrange(year, Rank) |>ungroup()# Plotbar_color <-c("orange", "#fde725", "#c2df23", "#86d549", "#52c569", "#2ab07f", "#1e9b8a", "#25858e", "#2d708e", "brown", "#38588c", "#433e85", "#482173", "#440154")animated_plot <-ggplot(grouped_data) +geom_col(aes(x = GainDays,y =fct_reorder(CompanyName, GainDays),fill = CompanyName),width =0.9) +geom_text(aes(x = GainDays, y = CompanyName, label = GainDays),hjust =-0.02, vjust =0.5) +theme_minimal() +theme(axis.text.y =element_text(size =10),axis.ticks.y =element_blank(),plot.margin =unit(c(1, 1, 3, 1), 'lines'),legend.position ="none",panel.grid.major=element_blank(),panel.grid.minor=element_blank(),panel.grid.major.x =element_line( size=.01, color="grey" )) +labs(x ="Gain Days",y =NULL ) +scale_x_continuous(breaks =seq(0, max(grouped_data$GainDays), by =50)) +ggtitle('Yearwise Gain Days of Big Tech Companies: {closest_state}') +scale_fill_manual(values = bar_color) +transition_states(year,transition_length =1,state_length =10)# View the animated plotanimated_plot``````{r q2_graph1}#| label: q2_graph2#| message: FALSE#| warning: FALSE#| echo: FALSE#| fig-width: 8#| fig-height: 6#| fig-align: center#| dpi: 300 # Calculate gain daysgain_days <- big_tech_stock_prices |> mutate( year = lubridate::year(date) , quarter = lubridate::quarter(date), weekday = weekdays(date), gain = if_else(close - open > 0, 1, 0) ) |> group_by(stock_symbol,year,quarter,weekday) |> summarise(gain_count = sum(gain), .groups = "drop")weekday_order <- c("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")company_colors <- c( "Adobe" = "orange", "Alphabet" = "#fde725", "Amazon" = "#c2df23", "Apple" = "#86d549", "Cisco" = "#52c569", "IBM" = "#2ab07f", "Intel" = "#1e9b8a", "Meta" = "#25858e", "Microsoft" = "#2d708e", "Netflix" = "brown", "NVIDIA" = "#38588c", "Oracle" = "#433e85", "Salesforce" = "#482173", "Tesla" = "#440154")# Join the data and Plot density ridgesleft_join(gain_days,big_tech_companies) |> ggplot(aes(x = gain_count, y = factor(weekday, levels = weekday_order), fill = CompanyName)) + geom_density_ridges(scale = 3, rel_min_height = 0.01, alpha = 0.7) + scale_fill_manual(values = company_colors) + labs(title = "Distribution of Gain Days by Weekday", subtitle = "Averaged per Quarter in last 10 years", x = NULL, y = NULL) + theme_minimal() + theme(axis.text.x = element_text(angle = 45, hjust = 1), panel.grid.major = element_blank(), panel.grid.minor = element_blank(), panel.border = element_blank(), axis.line = element_line(color = "black"), plot.title = element_text(size = 16, face = "bold"), axis.title = element_text(size = 12, face = "bold"), legend.position = "none") + coord_cartesian(xlim = c(0, 12)) + facet_wrap(~ CompanyName)```### Discussion\<\<\< Team-2 to write \>\>## References- https://stackoverflow.com/questions/10576095/formatting-dates-with-scale-x-date-in-ggplot2- https://viz-ggplot2.rsquaredacademy.com/ggplot2-text-annotations